package com.situ.ssm.service.singleton;
//懒汉式
public class Singleton {
	private static Singleton instance = null;
	
	//1、私有化构造方法，只能在类的内部实例化这个对象
	private Singleton() {
	}
	
	public synchronized static Singleton getInstance() {
		if (null == instance) {
			instance = new Singleton();
		}
		return instance;
	}
}
